unit F_frmMain;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, ADODB, ActnList, dxBar, cxClasses, ExtCtrls, StdCtrls,
   Buttons, DBAccess, Uni,
    UniProvider, SQLiteUniProvider, MemDS, cxGraphics, cxLookAndFeels,
  cxLookAndFeelPainters, Menus, cxButtons;

type
  TfrmMain = class(TForm)
    dxbrmngr1: TdxBarManager;
    dxbrmngr1Bar1: TdxBar;
    dxbrbtn1: TdxBarButton;
    dxbrsbtm1: TdxBarSubItem;
    actlst1: TActionList;
    actEditDish: TAction;
    actEditPage: TAction;
    dxBarSubItem1: TdxBarSubItem;
    dxbrlrgbtn1: TdxBarLargeButton;
    dxbrbtn2: TdxBarButton;
    dxbrbtn3: TdxBarButton;
    con1: TUniConnection;
    sqltnprvdr1: TSQLiteUniProvider;
    qryTmp: TUniQuery;
    actUpload: TAction;
    dxbrbtn4: TdxBarButton;
 
    procedure actEditDishExecute(Sender: TObject);
    procedure actEditPageExecute(Sender: TObject);
    procedure actUploadExecute(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }

  end;



var
  frmMain: TfrmMain;

implementation

{$R *.dfm}

uses
  F_frmDish, F_frmPage, U_DdhSizer,
  U_Public, F_frmUpload;



procedure TfrmMain.actEditDishExecute(Sender: TObject);
begin
  if nil = frmDish then
  frmDish := TfrmDish.Create(Application);

  frmDish.WindowState := wsMaximized;
end;

procedure TfrmMain.actEditPageExecute(Sender: TObject);
begin
  if nil = frmPage then
  frmPage := TfrmPage.Create(Application);

  frmPage.WindowState := wsMaximized;
end;



procedure TfrmMain.actUploadExecute(Sender: TObject);
begin
  with TfrmUpload.Create(Self) do
  try
    ShowModal
  finally
    Free;
  end;
end;

procedure TfrmMain.FormCreate(Sender: TObject);
begin
  con1.Database := GetAPPDir + '\Data\MenuBook.dat';
  con1.Connect;
end;

end.
